package oo.Day04;

public class Text {
    public static void main(String[] args) {
        Person[] ps = new Person[5];
        ps[0] = new Student("张三",17,"nmg","123456");
        ps[1] = new Student("李四",18,"巴西","123457");
        ps[2] = new Teacher("小三",37,"北极",1561.0);
        ps[3] = new Teacher("小四",48,"南极",7351.0);
        ps[4] = new Doctor("小王",23,"北京","主刀医师");
        for (int i=0;i<ps.length;i++){
            System.out.println(ps[i].name);
            ps[i].saiHi();
        }
        Student stu = new Student("张三",17,"nmg","123456");
        Person per = new Student("张三",17,"nmg","123456");
        stu.saiHi();
        per.saiHi();






//        //学生
//        Student[] stus = new Student[3];
//        stus[0] = new Student("张三",17,"nmg","123456");
//        stus[1] = new Student("李四",18,"巴西","123457");
//        stus[2] = new Student("王五",19,"澳大利亚","123458");
//        for (int i=0;i<stus.length;i++){
//            System.out.println(stus[i].name);
//            stus[i].saiHi();
//        }
//        //老师
//        Teacher[] tes = new Teacher[3];
//        tes[0] = new Teacher("小三",37,"北极",1561.0);
//        tes[1] = new Teacher("小四",48,"南极",7351.0);
//        tes[2] = new Teacher("小五",34,"赤道",4321.5);
//        for (int i=0;i<tes.length;i++){
//            System.out.println(tes[i].name);
//            tes[i].saiHi();
//        }
//        //医生
//        Doctor[] docs = new Doctor[2];
//        docs[0] = new Doctor("小明",45,"南京","药剂师");
//        docs[1] = new Doctor("小王",23,"北京","主刀医师");
//        for (int i=0;i<docs.length;i++){
//            System.out.println(docs[i].name);
//            docs[i].saiHi();
        }

    }

